﻿@page
@{ Layout = "_Layout"; }

<div style="height: 10px"></div>

<el-row :gutter="20">
  <el-col :span="4" style="text-align: right">
    剩余页面
  </el-col>
  <el-col :span="16">
    <el-badge :value="channelsCount" :type="channelsCount ? '' : 'primary'" style="margin-right: 20px">
      <el-button size="small">栏目页</el-button>
    </el-badge>
    <el-badge :value="contentsCount" :type="contentsCount ? '' : 'primary'" style="margin-right: 20px">
      <el-button size="small">内容页</el-button>
    </el-badge>
    <el-badge :value="filesCount" :type="filesCount ? '' : 'primary'" style="margin-right: 20px">
      <el-button size="small">文件页</el-button>
    </el-badge>
    <el-badge :value="specialsCount" :type="specialsCount ? '' : 'primary'" style="margin-right: 20px">
      <el-button size="small">专题页</el-button>
    </el-badge>
  </el-col>
  <el-col :span="4" style="text-align: right">
    <el-button v-if="channelsCount > 0 || contentsCount > 0 || filesCount > 0 || specialsCount > 0" type="danger" size="small" style="float: right;" icon="el-icon-close" v-on:click="btnCancelClick">取消生成任务</el-button>
  </el-col>
</el-row>

<div style="height: 10px;"></div>
<el-divider></el-divider>

<el-row v-for="task in tasks" :gutter="20">
  <el-col :span="4" style="text-align: right">
    <div style="margin: 5px 0">{{ task.type }}</div>
  </el-col>
  <el-col v-if="task.isPending" :span="20">
    <div style="margin: 5px 0" class="el-progress el-progress--line is-warning el-progress--text-inside">
      <div class="el-progress-bar">
        <div class="el-progress-bar__outer" style="height: 24px;">
          <div class="el-progress-bar__inner" style="width: 100%;">
            <div class="el-progress-bar__innerText">
              {{ task.name }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </el-col>
  <el-col v-else-if="task.isSuccess" :span="20">
    <div style="cursor: pointer; margin: 5px 0" v-on:click="btnRedirectClick(task)" class="el-progress el-progress--line is-success el-progress--text-inside">
      <div class="el-progress-bar">
        <div class="el-progress-bar__outer" style="height: 24px;">
          <div class="el-progress-bar__inner" style="width: 100%;">
            <div class="el-progress-bar__innerText">
              {{ task.name }}（用时：{{ task.timeSpan }}）
            </div>
          </div>
        </div>
      </div>
    </div>
  </el-col>
  <el-col v-else :span="20">
    <div style="margin: 5px 0" class="el-progress el-progress--line is-exception el-progress--text-inside">
      <div class="el-progress-bar">
        <div class="el-progress-bar__outer" style="height: 24px;">
          <div class="el-progress-bar__inner" style="width: 100%;">
            <div class="el-progress-bar__innerText">
              {{ task.name }}（错误：{{ task.errorMessage }}）
            </div>
          </div>
        </div>
      </div>
    </div>
  </el-col>
</el-row>

@section Scripts{
<script src="/sitefiles/assets/js/admin/cms/createStatus.js" type="text/javascript"></script> }